{extend name="base" /}
{block name="main"}
<div class="tpl-content-wrapper">
    <div class="tpl-content-page-title">
        询价列表
    </div>
    <ol class="am-breadcrumb">
        <li><a href="#" class="am-icon-home">首页</a></li>
        <li><a href="#">询价管理</a></li>
        <li class="am-active">询价列表</li>
    </ol>
    <div class="tpl-portlet-components">
        <div class="portlet-title">
            <div class="caption font-green bold">
                <span class="am-icon-code"></span> 列表
            </div>



        </div>
        <div class="tpl-block">
            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-6">
                    <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                            {if $status==1}
                            <a href="{:url('goods/Ask/index',['status'=>2])}" class="am-btn am-btn-default am-btn-success"> 查看已答复</a>
                            {else}
                            <a href="{:url('goods/Ask/index',['status'=>1])}" class="am-btn am-btn-default am-btn-success"> 查看待答复</a>
                            {/if}



                        </div>
                    </div>
                </div>


            </div>
            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main am-table-centered">
                            <thead>
                            <tr>
                                <th class="table-id">ID</th>
                                <th class="table-title">UID</th>
                                <th class="table-type">询价名</th>
                                <th class="table-type">股票代码</th>
                                <th class="table-date">价格</th>
                                <th class="table-date">权利金</th>
                                <th class="table-date">期权率</th>
                                <th class="table-date">交易周期</th>
                                <th class="table-date">名义本金</th>
                                <th class="table-date">询价时间</th>
                                <th class="table-date">答复时间</th>
                                <th class="table-date am-hide-sm-only">状态</th>
                                <th class="table-set">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {if empty($data)} <td colspan="13">无信息</td>
                            {else}
                            {volist name='data' id='ask'}
                            <tr>
                                <td>{$ask.id}</td>
                                <td>{$ask.uid}</td>
                                <td>{$ask.stockname}</td>
                                <td>{$ask.stockcode}</td>
                                <td>{$ask.stockprice}</td>
                                <td>{$ask.quanlijin}</td>
                                <td>{$ask.qiquanlv}</td>
                                <td>{$ask.jyzq}</td>
                                <td>{$ask.mybj}</td>
                                <td>{:formatTime($ask.xjtime)}</td>
                                <td>{if $ask.status==1}{else}{:formatTime($ask.dftime)}{/if}</td>
                                <td class="am-hide-sm-only">{if $ask.status==1}未答复{else}已答复{/if}</td>
                                <td>
                                    <div class="">
                                        <div class="am-btn-group am-btn-group-xs">
                                            {if $ask.status==1}<a href="{:url('goods/Ask/edit',['id'=>$ask.id])}" class="am-btn am-btn-default am-btn-xs am-hide-sm-only fff"><span class="am-icon-copy"></span>回复</a>{else}无{/if}
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            {/volist}
                            {/if}
                            </tbody>
                        </table>
                        <div class="am-cf">
                            <div class="am-fr">
                                {$data->render()}
                            </div>
                        </div>
                        <hr>

                    </form>
                </div>

            </div>
        </div>
        <div class="tpl-alert"></div>
    </div>

    <script>
        $(function () {
            $('.btn-del').click(function(){
                var id = $(this).attr('iddata');
                var obj = $(this).parents('tr');
                console.log($(this).attr('iddata'))
                if(confirm('你确定要删除该询价吗')){
                    delajax(id,obj,'/Ask');
//                    $('.rolecount').html($('.rolecount').html()-1);
                }
            })
        })
    </script>








</div>
{/block}